#pragma once

#include "PublicKey.h"
#include "SymmetricKey.h"
#include "CryptoFile.h"
#include "CryptoRecipient.h"
#include <vector>

namespace kryptos { namespace cryptography {

class EncryptionManager
{
public:
    EncryptionManager();
    virtual ~EncryptionManager();

    int encryptWithPublicKey(const std::string& file, const std::string& output, std::vector<PublicKey> recipients);
    int encryptWithHybridFormat(const std::string& file, const std::string& output, std::vector<PublicKey> recipients, SymmetricKey& symkey);

    int decrypt(const std::string& file, const std::string& output, const PrivateKey& privateKey, SymmetricKey& key);

    std::vector<CryptoRecipient> cryptoRecipients(const std::string& encryptedFile);

    CryptoFile::CryptoFormat cryptoFormat(const std::string& encryptedFile);

    std::string symmetricKeyNeeded(const std::string& encryptedFile, const PrivateKey& privateKey);

    unsigned long long symmetricKeyLengthNeededToDecrypt(const std::string& encryptedFile);

    bool isValidCryptoFile(const std::string encryptedFile);

private:

    int decryptPKCryptoFile(CryptoFile& cryptoFile, const std::string& output, const PrivateKey& privateKey);
    int decryptHybridCryptoFile(CryptoFile& cryptoFile, const std::string& output, const PrivateKey& privateKey, SymmetricKey& key);


};

}}
